<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <title><?php echo $this->_siteConfig->name;?></title>
    <link type="image/x-icon" href="<?php echo IUrl::creatUrl("")."favicon.ico";?>" rel="icon">
    <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="apple-touch-icon-precomposed" href="<?php echo $this->getWebSkinPath()."image/logo.gif";?>">
    <script type="text/javascript" charset="UTF-8" src="/git/micarshop/runtime/_systemjs/jquery/jquery-1.12.4.min.js"></script> <script type="text/javascript" charset="UTF-8" src="/git/micarshop/runtime/_systemjs/form/form.js"></script> <script type="text/javascript" charset="UTF-8" src="/git/micarshop/runtime/_systemjs/autovalidate/validate.js"></script><link rel="stylesheet" type="text/css" href="/git/micarshop/runtime/_systemjs/autovalidate/style.css" /> <script type="text/javascript" charset="UTF-8" src="/git/micarshop/runtime/_systemjs/artdialog/artDialog.js"></script><script type="text/javascript" charset="UTF-8" src="/git/micarshop/runtime/_systemjs/artdialog/plugins/iframeTools.js"></script><link rel="stylesheet" type="text/css" href="/git/micarshop/runtime/_systemjs/artdialog/skins/aero.css" /> <script type="text/javascript" charset="UTF-8" src="/git/micarshop/runtime/_systemjs/artTemplate/artTemplate.js"></script><script type="text/javascript" charset="UTF-8" src="/git/micarshop/runtime/_systemjs/artTemplate/artTemplate-plugin.js"></script>
    <script src="<?php echo $this->getWebViewPath()."javascript/common.js";?>"></script>
    <script src='<?php echo $this->getWebViewPath()."javascript/site.js";?>'></script>
    <link rel="stylesheet" href="<?php echo $this->getWebSkinPath()."style/style.css";?>">
</head>

<body>
    <!-- 顶部通栏 -->
    <header class="header_box">
        <div class="header">
            <?php if(IWeb::$app->getController()->getId() == 'site' && IWeb::$app->getController()->getAction()->getId() == 'index'){?>
            <div class="header_home"><i class="icon-home"></i></div>
            <?php }else{?>
            <div class="header_back" onclick="window.history.back();"><i class="icon-chevron-left"></i></div>
            <?php }?>
            <h1 id="page_title" class="page_title"><?php echo $this->_siteConfig->name;?></h1>
        
            <!-- <div class="header_so_btn" onclick="$('.header_search').toggle();"><i class="icon-search"></i></div> -->
            <div class="header_so_btn" onclick="jump_url()"><i class="icon-search"></i></div>
        
        </div>
    </header>
    <!-- 顶部搜索 -->
    <section class="header_search">
        <form method='get' action="<?php echo IUrl::creatUrl("/");?>">
            <input type='hidden' name='controller' value='site'>
            <input type='hidden' name='action' value='search_list'>
            <input class="keywords" type="text" name='word' autocomplete="off" placeholder="请输入关键词...">
            <input class="submit" type="submit" value="搜索">
        </form>
    </section>
    <!-- 引入内页 -->
    <section class="viewport">
        <?php $item = $this->order_info;?>
<div id="pageInfo" data-title="订单详情"></div>
<section class="user_order_detail">

	<table class="detail_table">
		<tr>
			<th>订单编号</th>
			<td><?php echo isset($item['order_no'])?$item['order_no']:"";?></td>
		</tr>
		<tr>
			<th>下单日期</th>
			<td><?php echo isset($item['create_time'])?$item['create_time']:"";?></td>
		</tr>

		<tr>
			<th>订单状态</th>
			<td><?php echo Order_Class::vrorderStatusText($orderStatus);?></td>
		</tr>
		<tr>
			<th>订单操作</th>
			<td>
				<?php if(in_array($orderStatus,array(1,2))){?>
				<input class="btn" type="button" value="取消订单" onclick='window.location.href="<?php echo IUrl::creatUrl("/ucenter/vr_order_status/order_no/".$this->order_info['order_no']."/op/cancel");?>"' />
				<?php }?>

				<?php if($orderStatus == 2){?>
				<input class="btn" type="button" value="立即付款" onclick="window.location.href='<?php echo IUrl::creatUrl("/block/doPay/order_no/".$item['order_no']."");?>'" />
				<?php }?>

				<?php if(in_array($orderStatus,array(11,3))){?>
				<input class="btn" type="button" value="确认已全部兑换服务" onclick='window.location.href="<?php echo IUrl::creatUrl("/ucenter/vr_order_status/order_no/".$this->order_info['order_no']."/op/confirm");?>"' />
				<?php }?>

				<?php if(Order_Class::isRefundmentApply($this->order_info)){?>
				<input class="btn" type="button" value="申请退款" onclick='window.location.href="<?php echo IUrl::creatUrl("/ucenter/refunds_edit/vr_order_id/".$item['id']."");?>"' />
				<?php }?>
			</td>
		</tr>
		<tr>
			<th>订单价格</th>
			<td>
				商品总金额：￥<?php echo isset($item['order_amount'])?$item['order_amount']:"";?>
				<label id="freightFee"><?php echo isset($item['real_freight'])?$item['real_freight']:"";?></label>
				<?php if($item['taxes'] > 0){?>
				<span class="red">+</span> 税金：￥<?php echo isset($item['taxes'])?$item['taxes']:"";?>
				<?php }?>
				<?php if($item['pay_fee'] > 0){?>
				<span class="red">+</span> 支付手续费：￥<?php echo isset($item['pay_fee'])?$item['pay_fee']:"";?>
				<?php }?>
				<?php if($item['insured'] > 0){?>
				<span class="red">+</span> 保价：￥<?php echo isset($item['insured'])?$item['insured']:"";?>
				<?php }?>
				<?php if($item['discount'] > 0){?>
				<span class="red">+</span> 订单涨价：￥<?php echo isset($item['discount'])?$item['discount']:"";?>
				<?php }?>
				<?php if($item['discount'] < 0){?>
				<span class="red">-</span> 订单折扣：￥<?php echo isset($item['discount'])?$item['discount']:"";?>
				<?php }?>
				<?php if($item['promotions'] > 0){?>
				<span class="red">-</span> 促销优惠金额：￥<?php echo isset($item['promotions'])?$item['promotions']:"";?>
				<?php }?>
			</td>
		</tr>
		<tr>
			<th>共需支付</th>
			<td>￥<?php echo isset($item['order_amount'])?$item['order_amount']:"";?></td>
		</tr>
		<tr>
			<th>支付方式</th>
			<td><?php echo isset($item['payment'])?$item['payment']:"";?></td>
		</tr>
		<?php if($this->order_info['paynote']){?>
		<tr>
			<th>支付说明</th>
			<td><?php echo isset($this->order_info['paynote'])?$this->order_info['paynote']:"";?></td>
		</tr>
		<?php }?>

		<?php if($item['invoice']==1){?>
		<tr>
			<th>所需税金</th>
			<td><?php echo isset($item['taxes'])?$item['taxes']:"";?></td>
		</tr>
		<tr>
			<th>发票抬头</th>
			<td><?php echo isset($item['invoice_title'])?$item['invoice_title']:"";?></td>
		</tr>
		<?php }?>
		<tr>
		<th><span class="red">兑换码</span></th>
		<td>
		<?php foreach($this->vr_order_codeinfo as $key => $item){?>
		<?php echo isset($item['vr_code'])?$item['vr_code']:"";?>
		<?php }?>
		</td>
		</tr>
	</table>

	<?php $order_id=$item['id']?> <?php foreach(Api::run('getVrOrderGoodsListByGoodsid',array('#order_no#',$item['order_no'])) as $key => $good){?> <?php $good_info = JSON::decode($good['goods_array'])?>
	<table class="detail_table">
		<tr>
			<th>商品</th>
			<td>
				<a href="<?php echo IUrl::creatUrl("/site/products/id/".$good['goods_id']."");?>">
					<img src="<?php echo IUrl::creatUrl("/pic/thumb/img/".$good['img']."/w/140/h/140");?>">
				</a>
			</td>
		</tr>
		<?php if($good['delivery_id']){?>
		<tr>
			<th>物流信息</th>
			<td>
				<input type='button' class='btn' value='点击查询' onclick="freightLine(<?php echo isset($good['delivery_id'])?$good['delivery_id']:"";?>);" />
			</td>
		</tr>
		<?php }?>
		<tr>
			<th>商品单价</th>
			<td>￥<?php echo isset($good['real_price'])?$good['real_price']:"";?></td>
		</tr>
		<tr>
			<th>商品数量</th>
			<td>x <?php echo isset($good['goods_nums'])?$good['goods_nums']:"";?></td>
		</tr>
		<tr>
			<th>赠送积分</th>
			<td><?php echo $good['point']*$good['goods_nums'];?></td>
		</tr>
		<tr>
			<th>优惠金额</th>
			<td>￥<?php echo ($good['goods_price']*100-$good['real_price'] *100 )/100;?></td>
		</tr>
	</table>
	<?php }?>
	</div>
</section>

<script>
	$(function(){
		hideNav()
	})
	//快递跟踪
	function freightLine(doc_id) {
		var urlVal = "<?php echo IUrl::creatUrl("/block/freight/id/@id@");?>";
		urlVal = urlVal.replace("@id@", doc_id);
		art.dialog.open(urlVal, {
			'title': '轨迹查询',
			'width': '80%',
			'height': '80%'
		});
	}

	//修改表单信息
	function editForm() {
		$('#acceptShow').toggle();
		$('#acceptForm').toggle();
	}
</script>

    </section>
    <!-- 会员登陆与否显示不同内容 -->
    <?php if($this->user){?>
    <?php }else{?>
    <!-- 
    <section class="footer_login">
        <a class="login" href="<?php echo IUrl::creatUrl("simple/login");?>">登录</a>
        <a class="reg" href="<?php echo IUrl::creatUrl("simple/reg");?>">注册</a>
    </section> -->
    <?php }?>
    <!--底部菜单-->
    <nav class="footer_nav">
        <ul>
            <li class="nav_home"><a href="<?php echo IUrl::creatUrl("site");?>"><i class="icon-home"></i><span>首页</span></a></li>
            <li class="nav_cart"><a href="<?php echo IUrl::creatUrl("simple/cart");?>"><i class="icon-shopping-cart"></i><span>购物车</span></a></li>
            <li class="nav_user"><a href="<?php echo IUrl::creatUrl("/ucenter/index");?>"><i class="icon-user"></i><span>个人中心</span></a></li>
            <li class="nav_map"><a href="<?php echo IUrl::creatUrl("site/sitemap");?>"><i class="icon-reorder"></i><span>分类</span></a></li>
        </ul>
    </nav>
    <script src='<?php echo $this->getWebViewPath()."javascript/mobile.js";?>'></script>
</body>

</html>

<script type="text/javascript">

var ex = "http://"+window.location.host+"/";
function jump_url(){
	
	//window.location.href = ex+"site/goseachpage";
	window.location.href = ex+"git/micarshop/site/goseachpage";
	
}

</script>

